-
Notifications
You must be signed in to change notification settings - Fork 906
add support for request_get_status_any/all/some #13279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
add support for request_get_status_any/all/some #13279
Conversation
d233c73
to
723b84e
Compare
Let me know if you want help with the python binding infrastructure. |
@hppritcha yes, I would appreciate some help on that front (and the same applies for the fortran bindings, even if its just a conversation that I understand what needs to be done). |
efd9cf5
to
f21dff7
Compare
@edgargabriel added new data type to the bindings code to add this new use of |
I'll work on the fortran but that will have to wait till later in the week. |
note that mpi4py is probably not testing this since it keys off our MPI_Get_version return values for major/minor. |
@hppritcha thank you very much, I will test it later this week. I have not done the mpi4py test that you mentioned, will look into this as well. |
Signed-off-by: Edgar Gabriel <edgar.gabriel@amd.com>
add the man pages for the newly implemented MPI_Request_get_status_all/any/some functions. Signed-off-by: Edgar Gabriel <edgar.gabriel@amd.com>
Three new functions were added to the MPI API as part of the 4.1 standard. These used an array of const MPI_Request s which the bindings code didn't support. This commit also fixes back the mpi.h prototypes to include the constants and required changes to the new template files. Signed-off-by: Howard Pritchard <howardp@lanl.gov>
a2aa8f9
to
81e3492
Compare
faking MPI 4.1. for mpi4py doesn't work unfortunately, we fail the compilation of mpi4py due to other missing function (MPI_Buffer_flush etc.). I will write some tests for the new functions. |
also switch MPI_Request_get_status to use new method for generating f08 bindings. Update fortran bindings interfaces generation code. f90/f77 interfaces will be added as another commit. Signed-off-by: Howard Pritchard <howardp@lanl.gov>
for new fortran methods starting with MPI_Request_get_status_(any/all/some) plus switch MPI_Request_get_status to use the binding infrastructure as well. Signed-off-by: Howard Pritchard <howardp@lanl.gov>
Signed-off-by: Howard Pritchard <howardp@lanl.gov>
@edgargabriel i pushed the remainder of the fortran related files to the PR - hopefully. |
@hppritcha thank you! I hope to finish up adding tests to the ibm testsuite for the new function this weekend, and hopefully next week we could merge the PR if all tests pass. |
I added some tests for request_get_status_any/all/some to the ompi-tests private testsuite, and they pass. This is however only testing the C-interfaces of the function. The tests are also probably not entirely bullet-proof in terms of that they might miss some corner cases, but the base function is shown to be working. |
parser_interface.add_argument('--fort-std', choices=('f90', 'f08'), | ||
help='fortran standard to use for fortran module generation') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hppritcha I see --fort-std
added in both parser_code
and parser_interface
-- is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it is. i can look if it makes sense to put in the higher level "fortran parser".
@@ -37,12 +37,16 @@ def main(): | |||
subparsers_fortran = parser_fortran.add_subparsers() | |||
parser_code = subparsers_fortran.add_parser('code', help='generate binding code') | |||
parser_code.set_defaults(handler=lambda args, out: fortran.generate_code(args, out)) | |||
parser_code.add_argument('--lang', choices=('fortran', 'c'), | |||
parser_code.add_argument('--lang', choices=('fortran', 'c', 'f90'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hppritcha What is the f90
choice for? I don't see that being checked for in the python code -- am I missing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its implied in the check around line 297 in fortran.py but i'll make it explicit. its suppose to mean generate the "f90" aka use mpi fortran interfaces.
int i; | ||
all_done = true; | ||
for (i = 0; i < count; i++) { | ||
one_done = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is one_done
ever set to true? I think the "if" conditional below is incorrect.
bool one_done; | ||
|
||
#if OPAL_ENABLE_PROGRESS_THREADS == 0 | ||
int do_it_once = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to make this an int
instead of bool
?
:ref:`MPI_Request_get_status_all` |mdash| Access information associated with a | ||
request without freeing the request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're access information with all active requests in an array -- not just a request.
status entries are undefined. | ||
|
||
If your application does not need to examine the *status* field, you can | ||
save resources by using the predefined constant ``MPI_STATUS_IGNORE`` as a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean MPI_STATUSES_IGNORE
?
@@ -54,7 +54,7 @@ PROTOTYPE ERROR_CLASS request_get_status_all(INT count, REQUEST_INOUT requests:c | |||
if (NULL == requests) { | |||
rc = MPI_ERR_REQUEST; | |||
} else { | |||
if(!ompi_request_check_same_instance(requests, count) ) { | |||
if(!ompi_request_check_same_instance((MPI_Request *)requests, count) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why cast? Is there a reason the 1st arg to ompi_request_check_same_instance
isn't const
?
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); | ||
|
||
if (MPI_SUCCESS == c_ierr) { | ||
*flag = OMPI_INT_2_FINT(c_flag); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flag
is a LOGICAL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same below. you need to look at the generated fortran code to see how this works.
if (MPI_SUCCESS == c_ierr) { | ||
|
||
*indx = OMPI_INT_2_FINT(c_indx); | ||
*flag = OMPI_INT_2_FINT(c_flag); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flag
is a LOGICAL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope it isn't there. See how the inner fortran binding works once you build the code out.
|
||
if (MPI_SUCCESS == c_ierr) { | ||
OMPI_SINGLE_INT_2_FINT(outcount); | ||
OMPI_ARRAY_INT_2_FINT(array_of_indices, *incount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be *outcount?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yes. it should be *outcount
Add support for the new
MPI_Request_get_status_any/all/some
functions introduced with MPI 4.1This PR contains the C implementation for the functions as well as the man-pages.
There are however also some things missing:
const MPI_Request[]
, (I have currently removed theconst
from the function definitions in mpi.h.in in order to make the code compile).